﻿package com.yy.ui.controls {
    import flash.display.*;
    import flash.filters.*;

    public class Button extends ButtonBase {

        public function Button(_arg1:Object=null){
            this.skin = _arg1;
        }
        override protected function mouseOver():void{
            if (enable){
                this.skinGotoAndStop(2);
            };
        }
        override protected function mouseOut():void{
            if (enable){
                this.skinGotoAndStop(1);
            };
        }
        override protected function mouseDown():void{
            if (enable){
                this.skinGotoAndStop(3);
            };
        }
        
        override public function set enable(_arg1:Boolean):void{
            super.enable = _arg1;
            this.skinGotoAndStop(1);
            if (_arg1){
                this.filters = [];
                this.buttonMode = true;
            } else {
                this.filters = [new ColorMatrixFilter([0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0])];
                this.buttonMode = false;
            };
        }
        protected function skinGotoAndStop(_arg1:int):void{
            var _local2:MovieClip;
            if ((this.skin is MovieClip)){
                _local2 = (this.skin as MovieClip);
                if (_local2.totalFrames >= _arg1){
                    _local2.gotoAndStop(_arg1);
                };
            };
        }

    }
}